package com.smartEdu.module.thrift.client.helloworld;

import com.smartEdu.module.thrift.common.BaseTClient;
import com.smartEdu.module.thrift.common.ThriftClient;
import com.smartEdu.module.thrift.common.ThriftClient.TClientParam;
import com.smartEdu.module.thrift.server.helloworld.HelloWorldService;

public class HelloWorldTClient extends BaseTClient {
	
	public HelloWorldTClient(String host, int port, int socketTimeout, int connectTimeout, ThriftClient client) {
		TClientParam param = new TClientParam();
		param.host = host;
		param.port = port;
		param.socketTimeout = socketTimeout;
		param.connectTimeout = connectTimeout;
		this.client = client;
		client.initParams(param);
	}

	/**
	 * 初始化thriftclient参数
	 * 必须在构造函数里调用
	 */
	@Override
	public void initParams(TClientParam param) {
		client.initParams(param);
	}
	
	public HelloWorldService.Client getClient() {
		return getTClient(HelloWorldService.Client.class);
	}

}
